﻿using System;
using System.IO;
using System.Reflection;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace YJKRevitColumn.ColumnModule.Utils
{
	public class ImportData
	{
		public ExternalCommandData CommandData
		{
			get
			{
				return this.m_commandData;
			}
		}

		public string ImportFileFullName
		{
			get
			{
				return this.m_importFileFullName;
			}
			set
			{
				this.m_importFileFullName = value;
			}
		}

		public ImportFormat ImportFormat
		{
			get
			{
				return this.m_importFormat;
			}
			set
			{
				this.m_importFormat = value;
			}
		}

		public string Filter
		{
			get
			{
				return this.m_filter;
			}
		}

		public string ImportFolder
		{
			get
			{
				return this.m_importFolder;
			}
			set
			{
				this.m_importFolder = value;
			}
		}

		public string Title
		{
			get
			{
				return this.m_title;
			}
		}

		public ImportData(ExternalCommandData commandData, ImportFormat importFormat)
		{
			this.m_commandData = commandData;
			this.m_activeDoc = commandData.Application.ActiveUIDocument.Document;
			this.m_importFormat = importFormat;
			this.m_filter = string.Empty;
			this.Initialize();
		}

		private void Initialize()
		{
			string location = Assembly.GetExecutingAssembly().Location;
			this.m_importFolder = Path.GetDirectoryName(location);
			this.m_importFileFullName = string.Empty;
		}

		public virtual bool Import()
		{
			if (this.m_importFileFullName == null)
			{
				throw new NullReferenceException();
			}
			return true;
		}

		protected ExternalCommandData m_commandData;

		protected Document m_activeDoc;

		protected string m_importFolder;

		protected string m_importFileFullName;

		protected ImportFormat m_importFormat;

		protected string m_filter;

		protected string m_title;
	}
}
